﻿using BusinessRepository;
using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Threading.Tasks;
using BusinessEntity;
using BusinessEntity.Assets;
using BusinessEntity.QuerryEntity;
using BusinessRule.Organization;
using APICommond;
using BusinessEntity.HT;

namespace BusinessRule
{
    public class Contract
    {
        #region "合同字段设置"

        /// <summary>
        /// 获取合同字段设置信息
        /// </summary>
        /// <param name="htlxbh">合同类型编号</param>
        /// <returns></returns>
        public static async Task<DataTable> GetHT_ColShow(string htlxbh)
        {

            string sql = "select * from HT_ColShow where Htlxbh='" + htlxbh + "';";

            return await new RepositoryFactory().BaseRepository().FindTable(sql, null);

        }

        public static async Task UpdateHT_ColShow(HT_ColShow hT)
        {
            string sql = "update HT_ColShow set IsRed='" + hT.IsRed + "',IsShow='" + hT.IsShow + "' where Htlxbh='" + hT.Htlxbh + "' and Col='" + hT.Col + "'";
            await new RepositoryFactory().BaseRepository().ExecuteSql(sql);
        }
        #endregion

        #region "资产合同"
        public static async Task<(DataTable, int)> GetHT_Assets(HT_AssetsQuerry querry)
        {
            string str = " and 1=1 ";
            if (!string.IsNullOrEmpty(querry.Dwdm) && querry.Dwdm != "string")
            {
                str += "and Dwdm='" + querry.Dwdm + "'";
            }
            if (!string.IsNullOrEmpty(querry.Htbh) && querry.Htbh != "string")
            {
                str += " and a.Htbh='" + querry.Htbh + "'";
            }
            if (!string.IsNullOrEmpty(querry.Yczr) && querry.Yczr != "string")
            {
                str += " and Yczr like '%" + querry.Yczr + "%'";
            }

            if (!string.IsNullOrEmpty(querry.Zcbh) && querry.Zcbh != "string")
            {
                str += " and Zcbh like '%" + querry.Zcbh + "%'";
            }
            if (!string.IsNullOrEmpty(querry.Zt) && querry.Zt != "string")
            {
                str += " and a.zt='" + querry.Zt + "'";
            }

            if (querry.Gdrqe != null && querry.Gdrqs != null)
            {
                if (querry.Gdrqe > querry.Gdrqs)
                {
                    str += " and (Gdrq>='" + querry.Gdrqs + "' and Gdrq<='" + querry.Gdrqe + "')";
                }
            }
            string sql = @"select a.*,b.dwdm,b.dwmc from HT_Assets a left join ZC_ZCKP b on a.zcbh=b.zcdm  where dwdm in " + querry.DepartID + str;
            bool isAsc = true;
            if (querry.Sort.ToUpper() != "ASC")
            {
                isAsc = false;
            }
            return await new RepositoryFactory().BaseRepository().FindTable(sql, null, querry.SortString, isAsc, querry.Size, querry.Current);

        }

        public static async Task InsertHT_Assets(HT_Assets ht)
        {
            await new RepositoryFactory().BaseRepository().Insert(ht);

        }

        public static async Task UpdateHT_Assets(HT_Assets ht)
        {
            await new RepositoryFactory().BaseRepository().Update(ht);
        }

        public static async Task DeleteHT_Assets(string Listid)
        {
            string sql = "update HT_Assets set zt='0' where ListID='" + Listid + "'";
            await new RepositoryFactory().BaseRepository().ExecuteSql(sql);
        }

        public static async Task<DataTable> GetHT_AssetsByID(string listid)
        {

            string sql = @"select a.*,b.dwdm,b.dwmc from HT_Assets a left join ZC_ZCKP b on a.zcbh=b.zcdm where a.ListID='" + listid + "'";

            return await new RepositoryFactory().BaseRepository().FindTable(sql, null);

        }

        #endregion

        #region"获取合同编号"
        public static async Task<DataTable> GetHT_GetHTBH(string htlx)
        {
            string sql = "";
            if (htlx == "采购合同")
            {
                sql = "select   'CGHT'+cast(ceiling(rand() * 9) as varchar ) +CONVERT(varchar(11),GETDATE(),112)+REPLACE(CONVERT(varchar(12),GETDATE(),108),':','') as htbh;";
            }
            if (htlx == "项目合同")
            {
                sql = "select 'XMHT'+cast(ceiling(rand() * 9) as varchar ) +CONVERT(varchar(11),GETDATE(),112)+REPLACE(CONVERT(varchar(12),GETDATE(),108),':','') as htbh;";
            }
            if (htlx == "通用付款合同")
            {
                sql = "select 'FKHT'+cast(ceiling(rand() * 9) as varchar ) +CONVERT(varchar(11),GETDATE(),112)+REPLACE(CONVERT(varchar(12),GETDATE(),108),':','') as htbh;";
            }
            if (htlx == "租赁合同")
            {
                sql = "select 'ZLHT'+cast(ceiling(rand() * 9) as varchar ) +CONVERT(varchar(11),GETDATE(),112)+REPLACE(CONVERT(varchar(12),GETDATE(),108),':','') as htbh;";
            }

            if (htlx == "通用收款合同")
            {
                sql = "select 'SKHT'+cast(ceiling(rand() * 9) as varchar ) +CONVERT(varchar(11),GETDATE(),112)+REPLACE(CONVERT(varchar(12),GETDATE(),108),':','') as htbh;";
            }


            return await new RepositoryFactory().BaseRepository().FindTable(sql, null);

        }
        #endregion


        #region"获取合同列表"
        public static async Task<(DataTable, int)> GetHT_List(HT_List querry)
        {
            string str = " and 1=1 ";
            if (!string.IsNullOrEmpty(querry.htmc) && querry.htmc != "string" && querry.htmc != null)
            {
                str += "and htmc like '%" + querry.htmc + "%'";
            }
            if (!string.IsNullOrEmpty(querry.htlx) && querry.htlx != "string" && querry.htlx != null)
            {
                str += "and htlx = '" + querry.htlx + "'";
            }
            if (!string.IsNullOrEmpty(querry.htbh) && querry.htbh != "string" && querry.htbh != null)
            {
                str += "and htbh = '" + querry.htbh + "'";
            }
            if (querry.je1 != null || querry.je2 != null)
            {
                str += " and htje between '" + querry.je1 + "' and '" + querry.je2 + "'";
            }
            if (!string.IsNullOrEmpty(querry.zt) && querry.zt != "string" && querry.zt != null)
            {
                str += "and zt = '" + querry.zt + "'";
            }
            if (!string.IsNullOrEmpty(querry.listid) && querry.listid != "null" && querry.listid != "string")
            {
                //int id = 0;
                //if (int.TryParse(querry.listid, out id))
                //{
                //    if (id > 0)aaz
                //    {
                //        str += " and listid='" + querry.listid + "'";
                //    }
                //}
                str += " and businessId='" + querry.listid + "'";
            }
            if (querry.wfje==0)
            {
                str += " and wfje>"+querry.wfje;
            }
            //else
            //{
            //    str += " and businessId='" + querry.htbh + "'";
            //}
            if (querry.sqrq1 != null && querry.sqrq2 != null)
            {
                if (querry.sqrq2 > querry.sqrq1)
                {
                    DateTime sqjsrq = Convert.ToDateTime(querry.sqrq2);
                    string jsrq = sqjsrq.ToString("yyyyMMdd");
                    DateTime sqksrq = Convert.ToDateTime(querry.sqrq1);
                    string ksrq = sqksrq.ToString("yyyyMMdd");
                    str += " and (sqrq>='" + ksrq + "' and sqrq<='" + jsrq + "')";
                }
            }
            string sql = "select * from vw_ht_list where bmdm in " + querry.DepartID + "  and  zt>='3' " + str;
            bool isAsc = true;
            if (querry.Sort.ToUpper() != "ASC")
            {
                isAsc = false;
            }
            return await new RepositoryFactory().BaseRepository().FindTable(sql, null, querry.SortString, isAsc, querry.Size, querry.Current);


        }

        public static async Task<(DataTable, int)> GetHT_skList(HT_List querry)
        {
            string str = " and 1=1 ";
            if (!string.IsNullOrEmpty(querry.search) && querry.search != "string" && querry.search != null)
            {
                str += "and ( htbh like '%" + querry.search + "%' or htmc like '%" + querry.search + "%' or htlx like '%" + querry.search + "%' or htje like '%" + querry.search + "%' or jfmc like '%" + querry.search + "%' or jffrdb like '%" + querry.search + "%' or jfdbry like '%" + querry.search + "%' or jflxdh like '%" + querry.search + "%' or jffdzd like '%" + querry.search + "%' or htksrq like '%" + querry.search + "%' or htjsrq like '%" + querry.search + "%'or yfmc like '%" + querry.search + "%' ) ";
            }
            //if (!string.IsNullOrEmpty(querry.htmc) && querry.htmc != "string" && querry.htmc != null)
            //{
            //    str += "and htmc like '%" + querry.htmc + "%'";
            //}
            //if (!string.IsNullOrEmpty(querry.htlx) && querry.htlx != "string" && querry.htlx != null)
            //{
            //    str += "and htlx = '" + querry.htlx + "'";
            //}
            string sql = "select * from vw_ht_sklist where zt='3' and wsje>0 and bmdm in " + querry.DepartID + str;
            bool isAsc = true;
            if (querry.Sort.ToUpper() != "ASC")
            {
                isAsc = false;
            }
            return await new RepositoryFactory().BaseRepository().FindTable(sql, null, querry.SortString, isAsc, querry.Size, querry.Current);


        }

        public static async Task<DataTable> GetskList(string htbh)
        {

            string sql = "select * from vw_ht_sklist where htbh in(" + htbh + ") order by htbh";

            return await new RepositoryFactory().BaseRepository().FindTable(sql, null);


        }

        public static async Task<(DataTable, int)> GetHT_OrderList(HT_List querry)
        {
            string sql = "";
            string str = " and 1=1 ";
            string s = " 1=1 ";

            if (querry.htlx == "收款")
            {
                if (!string.IsNullOrEmpty(querry.htbh) && querry.htbh != "string" && querry.htbh != null)
                {
                    str += "and projectCode= '" + querry.htbh + "'";
                }
                if (!string.IsNullOrEmpty(querry.skmc) && querry.skmc != "string" && querry.skmc != null)
                {
                    str += "and skmc like '%" + querry.skmc + "%'";
                }
                if (!string.IsNullOrEmpty(querry.collectionaccount) && querry.collectionaccount != "string" && querry.collectionaccount != null)
                {
                    str += "and collectionaccount like '%" + querry.collectionaccount + "%'";
                }
                if (!string.IsNullOrEmpty(querry.zt) && querry.zt != "string" && querry.zt != null)
                {
                    str += "and a.zt= '" + querry.zt + "'";
                }
                sql = "select a.*,jhskrq from ht_skxx a left join HT_SKJH b on a.projectCode=b.HTBH and a.planid=b.ListID where collectiontype='已对账' and a.zt='3' " + str;
            }
            if (querry.htlx == "付款")
            {
                if (!string.IsNullOrEmpty(querry.htbh) && querry.htbh != "string" && querry.htbh != null)
                {
                    s += "and htbh= '" + querry.htbh + "'";
                }
                sql = "select * from ht_order where" + s;
            }
            bool isAsc = true;
            if (querry.Sort.ToUpper() != "ASC")
            {
                isAsc = false;
            }
            return await new RepositoryFactory().BaseRepository().FindTable(sql, null, querry.SortString, isAsc, querry.Size, querry.Current);


        }

        #endregion
        #region"获取变更合同列表"
        public static async Task<(DataTable, int)> GetHT_ListBGD(HT_List querry)
        {
            string str = "and  1=1 ";
            if (!string.IsNullOrEmpty(querry.htmc) && querry.htmc != "string" && querry.htmc != null)
            {
                str += "and htmc like '%" + querry.htmc + "%'";
            }
            if (!string.IsNullOrEmpty(querry.htbh) && querry.htbh != "string" && querry.htbh != null)
            {
                str += "and htbh like '%" + querry.htbh + "%'";
            }
            if (!string.IsNullOrEmpty(querry.htlx) && querry.htlx != "string" && querry.htlx != null)
            {
                str += "and htlx = '" + querry.htlx + "'";
            }
            if (!string.IsNullOrEmpty(querry.htzt) && querry.htzt != "string" && querry.htzt != null)
            {
                str += "and htzt = '" + querry.htzt + "'";
            }
            string sql = "select * from vw_ht_BGDlist where bmdm in " + querry.DepartID + str;
            //  string sql = @"select * from vw_ht_skhtgl where bmdm in " + querry.DepartID + str;

            bool isAsc = true;
            if (querry.Sort.ToUpper() != "ASC")
            {
                isAsc = false;
            }
            return await new RepositoryFactory().BaseRepository().FindTable(sql, null, querry.SortString, isAsc, querry.Size, querry.Current);


        }

        public static async Task<DataTable> GetHT_BGDrecord(string htbh, string htlx)
        {
            string sql = "";
            if (htlx == "采购合同")
            {
                sql = "select * from ht_cght_bgd where htbh='" + htbh + "' ;";
            }
            if (htlx == "通用付款合同")
            {
                sql = "select * from ht_tyfkht_bgd where htbh='" + htbh + "' ;";
            }
            if (htlx == "租赁合同")
            {
                sql = "select * from ht_zlht_bgd where htbh='" + htbh + "' ;";
            }
            if (htlx == "通用收款合同")
            {
                sql = "select * from ht_tyskht_bgd where htbh='" + htbh + "' ;";
            }

            return await new RepositoryFactory().BaseRepository().FindTable(sql, null);

        }

        #endregion

        #region"获取合同执行情况"

        public static async Task<DataTable> InsertHT_Order(string struid, string htbh, decimal? zfje, DateTime? createdate, string createuser, string approveStatus, string commonId)
        {
            //  string sql = "";

            //      sql = "insert into HT_Order(struid,htbh,zfje,createdate,createuser) values ('" + struid + "','" + htbh + "','" +zfje + "','" + createdate + "','" + createuser + "');";
            //  sql += "update HT_CGHT set zfje =(select SUM(zfje) from HT_Order where htbh='"+htbh+"' )  where htbh='"+htbh+"'";
            ////  sql += "update HT_XMHT set zfje =(select SUM(zfje) from HT_Order where htbh='" + htbh + "' )  where htbh='" + htbh + "'";
            //  sql += "update ht_tyfkht set zfje =(select SUM(zfje) from HT_Order where htbh='" + htbh + "' )  where htbh='" + htbh + "'";

            string strsql = "";



            if (approveStatus == "checked")
            {
                strsql = "delete ht_order  where listid='" + commonId + "'; "+"insert into ht_order (listid,htbh,zfje,createdate,createuser) values('" + commonId + "','" + htbh + "','" + zfje + "','" + createdate + "','" + createuser + "') ";

            }
            else
            {
                strsql = "delete ht_order  where listid='" + commonId + "' ";
            }
            //strsql = "update ht_htzb set zfje =(select SUM(nvl(zfje,0)) from ht_order where htbh='" + htbh + "' )  where htbh='" + htbh + "' ";
            strsql += "update HT_CGHT set zfje =(select SUM(zfje) from HT_Order where htbh='" + htbh + "' )  where htbh='" + htbh + "'";
            //  sql += "update HT_XMHT set zfje =(select SUM(zfje) from HT_Order where htbh='" + htbh + "' )  where htbh='" + htbh + "'";
            strsql += "update ht_tyfkht set zfje =(select SUM(zfje) from HT_Order where htbh='" + htbh + "' )  where htbh='" + htbh + "'";
            return await new RepositoryFactory().BaseRepository().FindTable(strsql, null);

        }

        public static async Task<(DataTable, int)> GetHT_Order(HT_Order querry)
        {
            string sql = "";
            //string str = " and 1=1 ";

            //if (!string.IsNullOrEmpty(querry.htlx) && querry.htlx != "string" && querry.htlx != null)
            //{
            //    str += "and htlx = '" + querry.htlx + "'";
            //}
            if (querry.htlx == "项目合同")
            {
                sql = "select '' as xm,htid as htbh,isnull(zfje,0) as bxje,isnull(htje,0)-ISNULL(zfje,0) as syje,zfrq as createdate,'' as createuser from View_ProFKSQLists where htid='" + querry.htbh + "' ";
            }
            else
            {
                sql = "select b.xm,a.htbh,b.zfje as bxje,a.htje-b.zfje as syje,b.createdate,b.createuser from vw_ht_fkhtgl a,vw_ht_order b where a.htbh='" + querry.htbh + "' and b.htbh='" + querry.htbh + "' ";
            }
            bool isAsc = true;
            if (querry.Sort.ToUpper() != "ASC")
            {
                isAsc = false;
            }
            return await new RepositoryFactory().BaseRepository().FindTable(sql, null, querry.SortString, isAsc, querry.Size, querry.Current);


        }
        #endregion


        #region"获取保证金列表"
        public static async Task<(DataTable, int)> GetHT_BZJ(HT_List querry)
        {
            string str = "  1=1 ";
            if (!string.IsNullOrEmpty(querry.htmc) && querry.htmc != "string" && querry.htmc != null)
            {
                str += "and htmc like '%" + querry.htmc + "%'";
            }
            if (!string.IsNullOrEmpty(querry.htlx) && querry.htlx != "string" && querry.htlx != null)
            {
                str += "and htlx = '" + querry.htlx + "'";
            }
            if (!string.IsNullOrEmpty(querry.htbh) && querry.htbh != "string" && querry.htbh != null)
            {
                str += "and htbh like '%" + querry.htbh + "%'";
            }
            string sql = "select * from vw_ht_bzj where " + str;
            bool isAsc = true;
            if (querry.Sort.ToUpper() != "ASC")
            {
                isAsc = false;
            }
            return await new RepositoryFactory().BaseRepository().FindTable(sql, null, querry.SortString, isAsc, querry.Size, querry.Current);


        }
        public static async Task<DataTable> GetHT_BZJone(string listid)
        {
            string sql = "";

            sql = "select * from vw_ht_bzj where  listid='" + listid + "'   ";


            return await new RepositoryFactory().BaseRepository().FindTable(sql, null);

        }
        #endregion


        #region"金华钉钉合同"
        public static async Task<(DataTable, int)> GetHT_DDHT(HT_List querry)
        {
            string str = "where  1=1 ";
            if (!string.IsNullOrEmpty(querry.htmc) && querry.htmc != "string" && querry.htmc != null)
            {
                str += "and htmc like '%" + querry.htmc + "%'";
            }
            if (!string.IsNullOrEmpty(querry.htbh) && querry.htbh != "string" && querry.htbh != null)
            {
                str += "and htbh = '" + querry.htbh + "'";
            }
            string sql = "select *,case when htbh not in (select htbh from HT_TYFKHT) then '未部署' else '已部署' end as sfbs from HT_JHDDHT " + str;
            bool isAsc = true;
            if (querry.Sort.ToUpper() != "ASC")
            {
                isAsc = false;
            }
            return await new RepositoryFactory().BaseRepository().FindTable(sql, null, querry.SortString, isAsc, querry.Size, querry.Current);


        }


        public static async Task<DataTable> InsertHT_DDHT(HT_DDHT ht, string htbh)
        {

            // string  sql = "insert into  HT_JHDDHT (htbh) values ('" + htbh + "') ;";
            string htmc = "", htxgqksm = "", sshtfj = "", htfl = "", zdhtsm = "", htzxbm = "", xgbm = "", fwyj = "", title = "", createtime = "";

            foreach (form_component_values htdd in ht.process_instance.form_component_values)
            {

                if (htdd.name == "合同（协议）名称")
                {
                    //sql += "update HT_JHDDHT set htmc='"+htdd.value+"' where htbh='"+htbh+"' ; ";
                    htmc = htdd.value.ToString();
                }

                if (htdd.name == "合同（协议）相关情况说明")
                {
                    //sql += "update HT_JHDDHT set htxgqksm='" + htdd.value + "' where htbh='" + htbh + "' ; ";
                    htxgqksm = htdd.value.ToString();
                }

                if (htdd.name == "送审合同（协议）附件")
                {
                    //sql += "update HT_JHDDHT set sshtfj='" + htdd.value + "' where htbh='" + htbh + "' ; ";
                    sshtfj = htdd.value.ToString();
                }
                if (htdd.name == "合同分类")
                {
                    //sql += "update HT_JHDDHT set htfl='" + htdd.value + "' where htbh='" + htbh + "' ; ";
                    htfl = htdd.value.ToString();
                }
                if (htdd.id == "TextNote_1GB24BD6ZX280")
                {
                    //sql += "update HT_JHDDHT set zdhtsm='" + htdd.value + "' where htbh='" + htbh + "' ; ";
                    zdhtsm = htdd.value.ToString();
                }
                if (htdd.name == "合同执行部门")
                {
                    // sql += "update HT_JHDDHT set htzxbm='" + htdd.value + "' where htbh='" + htbh + "' ; ";
                    htzxbm = htdd.value.ToString();
                }
                if (htdd.name == "相关部门")
                {
                    // sql += "update HT_JHDDHT set xgbm='" + htdd.value + "' where htbh='" + htbh + "' ; ";
                    xgbm = htdd.value.ToString();
                }
                if (htdd.name == "法务意见")
                {
                    //sql += "update HT_JHDDHT set fwyj='" + htdd.value + "' where htbh='" + htbh + "' ; ";
                    fwyj = htdd.value.ToString();
                }
            }
            title = ht.process_instance.title.ToString();
            createtime = ht.process_instance.create_time.ToString();
            string sql = "insert into  HT_JHDDHT ( HTBH, htmc, htxgqksm, sshtfj, htfl, zdhtsm, htzxbm, xgbm, fwyj,tjr,createtime) values ('" + htbh + "','" + htmc + "','" + htxgqksm + "','" + sshtfj + "','" + htfl + "','" + zdhtsm + "','" + htzxbm + "','" + xgbm + "','" + fwyj + "','" + title + "','" + createtime + "') ; ";


            return await new RepositoryFactory().BaseRepository().FindTable(sql, null);

        }

        #endregion

        #region"权限"
        public static async Task<DataTable> UpdateHT_PermissionCode(HT_Permission ht)
        {
            string sql = "";
            if (ht.type == "insert")
            {
                sql = "insert into ht_PermissionCode (bmdm,zzjgdm) values('" + ht.dept_id + "','" + ht.code + "') ; ";
            }

            if (ht.type == "update")
            {
                sql = "update ht_PermissionCode set zzjgdm='" + ht.code + "' where bmdm='" + ht.dept_id + "' ; ";
            }

            if (ht.type == "delete")
            {
                sql += "delete ht_PermissionCode where  bmdm='" + ht.dept_id + "';";
            }




            // string sql = "insert into  HT_JHDDHT ( HTBH, htmc, htxgqksm, sshtfj, htfl, zdhtsm, htzxbm, xgbm, fwyj) values ('"+ht.htbh+"','"+ht. htmc+"','"+ht. htxgqksm+"','"+ht. sshtfj+"','"+ht. htfl+"','"+ht. zdhtsm+"','"+ht. htzxbm+"','"+ht. xgbm+"','"+ht. fwyj+"') ; " ;


            return await new RepositoryFactory().BaseRepository().FindTable(sql, null);

        }

        public static async Task<DataTable> Getbmdm(string code)
        {
            //string ver = "";

            string sql = "select bmdm from ht_PermissionCode where zzjgdm='" + code + "'  ;";





            return await new RepositoryFactory().BaseRepository().FindTable(sql, null);

        }


        public static async Task<string> GetLFpermission(string htbh, string DepartID)
        {
            string ver = "";

            string sql = "select * from vw_ht_skhtgl where htbh='" + htbh + "' and bmdm in " + DepartID + "; ";

            DataTable dataTable = await new RepositoryFactory().BaseRepository().FindTable(sql, null);
            if (dataTable.Rows.Count > 0)
            {
                ver = "是";

            }
            else
            {
                ver = "否";
            }
            return ver;
        }

        public static async Task<string> GetLFCJHT(string xmbh)
        {
            string ver = "";

            string sql = "select * from vw_ht_skhtgl where xmbh='" + xmbh + "' and htlx='产交合同'; ";

            DataTable dataTable = await new RepositoryFactory().BaseRepository().FindTable(sql, null);
            if (dataTable.Rows.Count > 0)
            {
                ver = "否";

            }
            else
            {
                ver = "是";
            }
            return ver;
        }

        public static async Task<DataTable> UpdateHT_Button(HT_Button ht)
        {
            string sql = "delete HT_Button ; ";
            sql += "insert into  HT_Button (RelevanceDD) values ('" + ht.RelevanceDD + "') ;";




            // string sql = "insert into  HT_JHDDHT ( HTBH, htmc, htxgqksm, sshtfj, htfl, zdhtsm, htzxbm, xgbm, fwyj) values ('"+ht.htbh+"','"+ht. htmc+"','"+ht. htxgqksm+"','"+ht. sshtfj+"','"+ht. htfl+"','"+ht. zdhtsm+"','"+ht. htzxbm+"','"+ht. xgbm+"','"+ht. fwyj+"') ; " ;


            return await new RepositoryFactory().BaseRepository().FindTable(sql, null);

        }
        public static async Task<DataTable> GetHT_Button()
        {

            string sql = "select * from ht_button ; ";



            return await new RepositoryFactory().BaseRepository().FindTable(sql, null);

        }


        #endregion
    }
}
